<!--
 * @Description:提取行间事件
 * @Author: Sun
 * @Date: 2019-07-01 20:05:50
 * @LastEditors: Sun
 * @LastEditTime: 2019-07-01 22:27:01
 -->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>提取行间事件window.onload</title>
  <script>
    window.onload = function () {
      let dv = document.getElementById("km")
      //获取标签的个数
      let lis = document.getElementsByTagName("li")
      console.log("lm",lis.length)

      dv.onclick = function () {
        dv['value'] = '提取行间事件window.onload'
      }
      

    }
  </script>
</head>

<body>
  <input id="km" type="button" value="皮肤1">
  <ul>
    <li>1 行间样式优先级别最高</li>
    <li>1.1如果先给行间 style 样式</li>
    <li>1.2 在给className 无效</li>
    <li>1.2 在给className 无效</li>
  </ul>
  <style>
    .d1 {
      background: #000;
      color: #fff;
    }

    .d2 {
      background: yellow;
      color: #000;
    }
  </style>


</body>

</html>